
function parseFormulas(formula:any,formData:any[]){
    let paramsStr = formula.match(/\(.+\)/)[0];
    paramsStr = paramsStr.substring(1,paramsStr.length - 1);
    paramsStr = paramsStr.replace(/\$/g, '').replace(/\#/g, '');

    formData.forEach((fitem:any) =>{
      let mid = paramsStr.match(fitem.id);
      if(mid){
        paramsStr = paramsStr.replace(fitem.id,fitem.value)
      }
    })

    // console.log({paramsStr});
    return paramsStr.split(',');
}

export default parseFormulas;